import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import 'package:xiongan_app_yy/provider/autopicking_provider.dart';
import 'package:xiongan_app_yy/provider/erp_info.dart';
import 'package:xiongan_app_yy/provider/fab_new_provider.dart';
import 'package:xiongan_app_yy/provider/into_handover_details_info_provider.dart';
import 'package:xiongan_app_yy/provider/message_provider.dart';
import 'package:xiongan_app_yy/provider/out_warehousing_provider.dart';
import 'package:xiongan_app_yy/provider/toreview_provider.dart';
import 'package:xiongan_app_yy/provider/user_info.dart';
import 'package:xiongan_app_yy/provider/warehouse_info.dart';

import 'automounting_provider.dart';
import 'into_warehousing_provider.dart';
import 'inv_counter_info.dart';
import 'libback_provider.dart';
import 'norderauditresult_info.dart';
import 'out_handover_details_info_provider.dart';

class Store {
  static init({Widget child}) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider<UserInfo>.value(
            value: UserInfo(
          phone: "xxxxxxxxxxx",
          imgSrc: "",
        )),
        ChangeNotifierProvider<ErpInfo>.value(value: ErpInfo()),
        ChangeNotifierProvider<CounterInfo>.value(value: CounterInfo()),
        ChangeNotifierProvider<WarehouseInfo>.value(value: WarehouseInfo()),
        ChangeNotifierProvider<AutoMountingProvider>.value(
          value: AutoMountingProvider(),
        ), //自动上架
        ChangeNotifierProvider<AutoPickingProvider>.value(
          value: AutoPickingProvider(),
        ), //自动拣选
        ChangeNotifierProvider<ToReviewProvider>.value(
          value: ToReviewProvider(),
        ), //复核
        ChangeNotifierProvider<LibBackProvider>.value(
          value: LibBackProvider(),
        ), //退库
        ChangeNotifierProvider<OutWareHousingProvider>.value(
          value: OutWareHousingProvider(),
        ), //出库作业
        ChangeNotifierProvider<IntoWareHousingProvider>.value(
          value: IntoWareHousingProvider(),
        ),
        ChangeNotifierProvider<OutHandoverDetailsInfoProvider>.value(
          value: OutHandoverDetailsInfoProvider(),
        ), //出库交接明细
        ChangeNotifierProvider<IntoHandoverDetailsInfoProvider>.value(
          value: IntoHandoverDetailsInfoProvider(),
        ),
        ChangeNotifierProvider<MessageProvider>.value(
          value: MessageProvider(),
        ), //入库交接明细
        ChangeNotifierProvider<NorderauditresultInfo>.value(
          value: NorderauditresultInfo(),
        ), //非预约审核
        ChangeNotifierProvider<FabNewProvider>.value(
          value: FabNewProvider(),
        ), //新建预约
      ],
      child: child,
    );
  }

  static T valueof<T>(BuildContext context) {
    Provider.of<T>(context);
  }
}
